#pragma once

#include <string>
#include <unordered_map>
#include <memory>

class Command;
typedef std::shared_ptr<Command> CommandPtr;

class CommandManager;
typedef std::shared_ptr<CommandManager> CommandManagerPtr;

class CommandManager
{
public:
	static CommandManagerPtr getSingleton();
	CommandManager();
	~CommandManager();

	void add(const CommandPtr &command);
	const CommandPtr &getCommand(const std::string &command_name, std::vector<std::string> &args) const;
	const CommandPtr &getCommand(const std::string &command_name) const;

protected:
	static CommandManagerPtr singleton;
	std::unordered_map<std::string, CommandPtr> commands;
	CommandPtr null_command;
};
